package top.zsyle.sycc.doc;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.math.BigDecimal;
import java.util.Date;

@Document(indexName = "course",type = "_doc")
@Data
public class CourseDoc {
    @Id // 标识当前字段是es文档的主键id
    private Long id;

    // 设置字段的类型
    @Field(type = FieldType.Text, analyzer = "ik_smart", searchAnalyzer = "ik_smart")
    private String name;

    @Field(type = FieldType.Keyword)
    private String gradeName;

    @Field(type = FieldType.Integer)
    private Integer charge;
    @Field(type = FieldType.Keyword)
    private String chargeName;
    @Field(type = FieldType.Double)
    private BigDecimal price;
    @Field(type = FieldType.Double)
    private BigDecimal priceOld;
    @Field(type = FieldType.Integer)
    private Integer validDays;
    @Field(type = FieldType.Integer)
    private Integer saleCount;
    @Field(type = FieldType.Integer)
    private Integer viewCount;
    @Field(type = FieldType.Integer)
    private Integer commentCount;
    @Field(type = FieldType.Keyword)
    private String typeName;
    @Field(type = FieldType.Integer)
    private Integer totalCount;
    @Field(type = FieldType.Text, analyzer = "ik_smart", searchAnalyzer = "ik_smart")
    private String forUser;
    @Field(type = FieldType.Long)
    private Long courseTypeId;
    @Field(type = FieldType.Long)
    private Long gradeId;
    @Field(type = FieldType.Date)
    private Date startTime;
    @Field(type = FieldType.Date)
    private Date endTime;
    @Field(type = FieldType.Keyword)
    private String pic;
    @Field(type = FieldType.Integer)
    private Integer totalMinute;
    @Field(type = FieldType.Integer)
    private Integer chapterCount;
    @Field(type = FieldType.Text, analyzer = "ik_smart", searchAnalyzer = "ik_smart")
    private String teacherNames;
    @Field(type = FieldType.Date)
    private Date onlineTime;

}
